//package com.douqu.game.main.platform;
//
//import com.douqu.game.core.database.model.UserModel;
//import com.douqu.game.core.factory.ConstantFactory;
//import com.douqu.game.core.protobuf.SGCommonProto;
//import com.douqu.game.core.util.LogUtils;
//import com.douqu.game.core.util.CoreUtils;
//import com.douqu.game.core.util.YjSdkUtils;
//import com.douqu.game.main.service.PlayerService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Component;
//
//import java.io.IOException;
//
///**
// * Author : wangzhfeeni
// * 2017-05-20 17:07
// */
//@Component
//public class YjImpl implements PlatformSDK {
//
//
//    @Autowired
//    private PlayerService playerService;
//
//    @Override
//    public UserModel login(String account, String password)
//    {
//        LogUtils.info("易接登录参数:" + account+"  " + password);
//        String [] param = password.split(ConstantFactory.DIVISION);
//        String app = null;
//        String sdk = null;
//        String uin = null;
//        String sess = null;
//        try {
//            app = param[0];
//            sdk = param[1];
//            uin = param[2];
//            sess = param[3];
//        } catch (Exception e) {
//            e.printStackTrace();
//            LogUtils.error("参数解析错误:" + password);
//            return new UserModel();
//        }
//        try {
//            if(!YjSdkUtils.checkUserLogin(app, sdk, uin, sess)){
//                LogUtils.error("易接认证信息获取数据失败:account->" + account + "  password->" + password);
//                return new UserModel();
//            }
//        } catch (IOException e) {
//            LogUtils.error("易接获取数据失败:" + account);
//            e.printStackTrace();
//            return new UserModel();
//        }
//
//        account = CoreUtils.createAccount(account, SGCommonProto.E_CHANNEL_TYPE.CHANNEL_TYPE_YJ);
//        UserModel player = playerService.getUserByAccount(account);
//
//        return player;
//    }
//
//
//}
